package lion.blog.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import lion.dev.lang.MapJ;
import lion.framework.core.web.ApplicationContext;
import lombok.Setter;

/**
 * 
 * 获取博客设置信息标签
 * 
 * @author lion
 * @email hl_0074@sina.com
 * @date 2015年8月28日
 */
public class SettingTag extends SimpleTagSupport {

	@Setter
	private String code;

	@Override
	public void doTag() throws JspException, IOException {

		MapJ codeBlock = (MapJ) ApplicationContext.get("blog");
		if (codeBlock.containsKey(code)) {
			getJspContext().getOut().write(codeBlock.getString(code));
		}
		super.doTag();
	}
}
